﻿using System;
using System.Text.RegularExpressions;

namespace RegexDemo
{
    class Program
    {
        const string StrInput = "1-201908270008-2.zc002";
        const string Patten = @"\d-\d{12}-\d\.zc\d{3}$";

        static void Main(string[] args)
        {
            var isMatch = Regex.IsMatch("1-201908270008-2.zc002", Patten);
            Console.WriteLine($"匹配是否成功: {isMatch}");

            var matches = Regex.Matches("1-201908270008-2.zc002", Patten);
            Console.WriteLine($"匹配数量: {matches.Count} 匹配字符: {matches[0]}");

            Console.WriteLine(StrInput[..^6]);
            Console.WriteLine(StrInput[^5..]);

            Console.ReadKey();
        }
    }
}
